home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / GoodBye / JohnKennedy / February96.lha / MASTERCLASS / MASTDEC.DOC < prev    next >
Encoding:
Text File  |  1996-09-30  |  8.9 KB  |  306 lines

  1. Masterclass
  2.  
  3. Which is the most important file on your Workbench disk? We
  4. reckon it's the Startup-sequence, and here's why.
  5.  
  6.  
  7.  
  8. S Revisted
  9. ----------
  10.  
  11. (ma1.iff)
  12.  
  13. Although we have touched on it before, the S directory is so
  14. important, it's worth taking another look at its contents.
  15. Here is what you will see if you open up the S directory on
  16. a virginal Workbench 3 machine. You'll need to use the
  17. Window menu and pick Show.. All Files to see the contents of
  18. S, because by default the files do not have any icons
  19. attached.
  20.  
  21. Here's the list of what S contains, and a brief explanation
  22. of that the various files do.
  23.  
  24.  
  25. Startup-Sequence
  26. ----------------
  27.  
  28. Without a doubt, this the most important file of all. When
  29. the Amiga starts to boot up after being switch on, it looks
  30. in the S: directory to see if Startup-sequence is present.
  31. If it is, it loads it and starts executing the list of
  32. AmigaDOS commands it contains. Several very important things
  33. are done by the startup-sequence, including patching any
  34. bugs in the operating systems, setting the keymap used by
  35. the keyboard, creating important directories and copying
  36. files to the RAM disk. Eventually, startup-sequence loads
  37. the Workbench environment.
  38.  
  39. Here's what a typical startup-sequence looks like. I've
  40. added the line numbers -- they aren't present in the file.
  41.  
  42.  
  43. [ 1] ; $VER: startup-sequence 39.9 (9.8.92)
  44. [ 2] 
  45. [ 3] C:SetPatch QUIET
  46. [ 4] C:Version >NIL:
  47. [ 5] C:AddBuffers >NIL: DF0: 15
  48. [ 6] FailAt 21
  49. [ 7] 
  50. [ 8] C:MakeDir RAM:T RAM:Clipboards RAM:ENV RAM:ENV/Sys
  51. [ 9] C:Copy >NIL: ENVARC: RAM:ENV ALL NOREQ
  52. [10] 
  53. [11] Resident >NIL: C:Assign PURE
  54. [12] Resident >NIL: C:Execute PURE
  55. [13] 
  56. [14] Assign >NIL: ENV: RAM:ENV
  57. [15] Assign >NIL: T: RAM:T
  58. [16] Assign >NIL: CLIPS: RAM:Clipboards
  59. [17] Assign >NIL: REXX: S:
  60. [18] Assign >NIL: PRINTERS: DEVS:Printers
  61. [19] Assign >NIL: KEYMAPS: DEVS:Keymaps
  62. [20] Assign >NIL: LOCALE: SYS:Locale
  63. [21] Assign >NIL: LIBS: SYS:Classes ADD
  64. [22] Assign >NIL: HELP: LOCALE:Help DEFER
  65. [23] 
  66. [24] IF NOT EXISTS SYS:Fonts
  67. [25]   Assign FONTS:
  68. [26] EndIF
  69. [27] 
  70. [28] BindDrivers
  71. [29] C:Mount >NIL: DEVS:DOSDrivers/~(#?.info)
  72. [30] 
  73. [31] IF EXISTS DEVS:Monitors
  74. [32]   IF EXISTS DEVS:Monitors/VGAOnly
  75. [33]     DEVS:Monitors/VGAOnly
  76. [34]   EndIF
  77. [35] 
  78. [36]   C:List >NIL: DEVS:Monitors/~(#?.info|VGAOnly) TO T:M LFORMAT "DEVS:Monitors/%s"
  79. [37]   Execute T:M
  80. [38]   C:Delete >NIL: T:M
  81. [39] EndIF
  82. [40] 
  83. [41] SetEnv Workbench $Workbench
  84. [42] SetEnv Kickstart $Kickstart
  85. [43] UnSet Workbench
  86. [44] UnSet Kickstart  
  87. [45] 
  88. [46] C:IPrefs
  89. [47] 
  90. [48] C:ConClip
  91. [49] 
  92. [50] Path >NIL: RAM: C: SYS:Utilities SYS:Rexxc SYS:System S: SYS:Prefs SYS:WBStartup 
  93.        ..SYS:Tools SYS:Tools/Commodities
  94. [51] 
  95. [52] IF EXISTS S:User-Startup
  96. [53]   Execute S:User-Startup
  97. [54] EndIF
  98. [55] 
  99. [56] Resident Execute REMOVE
  100. [57] Resident Assign REMOVE
  101. [58] 
  102. [59] C:LoadWB
  103. [60] EndCLI >NIL:
  104.  
  105.  
  106. Here's an what some of the more important lines are doing in
  107. the startup-sequence.
  108.  
  109. [ 3] Use the SetPatch command to fix any bugs in the
  110. operating system. The Quiet option stops any text from
  111. appearing on screen: this would cause the Shell to be
  112. displayed instead of the blank screen suddenly being
  113. replaced by the Workbench as it pops up.
  114.  
  115. [ 4] Use the Version command display the current Workbench
  116. and Kickstart release. However, the output is not printed on
  117. screen -- it's sent to the dummy device NIL: So, why do it?
  118. Because the command also passes the version into special
  119. variables "Kickstart" and "Workbench"
  120.  
  121. [ 5] This command sets aside some memory to act as a buffer
  122. for the internal floppy disk. This speeds up access. If you
  123. have a reasonable amount of RAM you might want to increase
  124. this number to 25. You can also add buffers to hard drives
  125. and other floppies if you wish: five are always added by
  126. default.
  127.  
  128. [ 6] This makes sure the script won't stop with an error if
  129. something bad happens. The error will be reported, but the
  130. script will carry on to the end.
  131.  
  132. [ 8] Four directories are created in the RAM disk: T,
  133. Clipboards, ENV and Sys.
  134.  
  135. [ 9] The contents of the directory ENVARC (including any
  136. sub-directories) are copied from the boot disk to the ENV
  137. directory in the RAM disk. It's here that many programs
  138. store their preferences and so copying to RAM can speed them
  139. all up quite a lot. It also ensures that any changes made to
  140. them are temporary until the contents are also saved to
  141. ENVARC. The NOREQ keyword stops any requestors from
  142. appearing on screen.
  143.  
  144. [11] Makes the command Assign resident, which means it is
  145. copied into memory to speed things up a little. Notice the
  146. use of the keyword PURE to force the command resident.
  147.  
  148. [12] Makes the command Execute resident.
  149.  
  150. [14] to [26] Makes some important assigns, that is, creates
  151. a new device name (such as REXX:) which points to directory
  152. or device which already exists. It's a way of creating
  153. shortcuts.
  154.  
  155. [28] BindDrivers is hardly used, but when it is it causes
  156. any extra hardware to appear to the Amiga by instigating
  157. it's driver software. So there.
  158.  
  159. [29] This line mounts all the AmigaDOS devices present in
  160. the directory DEVS:DOSDrivers.  This could include CrossDos
  161. devices, CDROM drives or specialist virtual devices such as
  162. PIPE:. Notice how all the files are mounted, except the
  163. icons files (which all end in .info) because of the use of
  164. ~(#?.info) which means "Not any file ending in ".info".
  165.  
  166. [31] to [39] These instructions process the list of monitors
  167. available by creating one large file (stored in T: and
  168. called M), executing it and then deleting it.
  169.  
  170. [41] Creates a variable in ENV: called Workbench, which
  171. contains the value in the variable called Workbench. This
  172. was defined way back in line [4] remember.
  173.  
  174. [42] Creates the Kickstart variable, as above.
  175.  
  176. [43] Deletes the temporary variable Workbench. The variable
  177. in ENV: is still available though.
  178.  
  179. [44] Deletes the temporary variable Kickstart.
  180.  
  181. [46] Runs the IPrefs program, which sets the preferences in
  182. the Workbench (colours, fonts, background and so on)
  183.  
  184. [48] Starts the console clipboard manager program.
  185.  
  186. [50] This long line defines the various paths which AmigaDOS
  187. will use when looking for commands. When you open a Shell
  188. and enter a command, AmigaDOS will examine all these
  189. directories in this order until it finds the command.
  190.  
  191. [52] to [54] If there is a file called user-startup in the
  192. S: directory, exectute it. This means that instead of adding
  193. commands to s:startup-sequence, you can add them instead to
  194. the file called user-startup.
  195.  
  196. [56] Remove the resident command Execute from memory.
  197.  
  198. [57] Remove the resident command Assign.
  199.  
  200. [59] Load the Workbench!
  201.  
  202. [60] Shut down the (invisable) Shell which has been
  203. executing this start-up sequence.
  204.  
  205.  
  206.  
  207.  
  208.  
  209. Shell-Startup
  210. -------------
  211.  
  212. Everytime you open up a Shell window to enter some commands,
  213. this script is loaded and executed. The default script is
  214. pretty tame:
  215.  
  216.  
  217. ; $VER: Shell-Startup 40.1 (9.2.93)
  218.  
  219. Prompt "%N.%S> "
  220. Alias Clear "Echo *"*E[0;0H*E[J*" "
  221. Alias XCopy "Copy CLONE "
  222.  
  223.  
  224. You can see that it defines the prompt which each Shell will
  225. use, and creates two more commands called Clear and XCopy.
  226. Clear will clear the window using a sequence of control
  227. codes. XCopy is useful for copying entire disks or
  228. directories in one go. If you would like to include you own
  229. AmigaDOS commands, this is where you define them.
  230.  
  231.  
  232. Ed-startup
  233. ----------
  234.  
  235. As you may know, AmigaDOS comes with its own text editor
  236. called ED. ED is a lot smarter than many people realise. By
  237. editing this file, you can customise the menus which Ed
  238. uses. There isn't space to go into detail now, but take a
  239. look at the file and try creating your own designer ED
  240. program to impress your mates.
  241.  
  242.  
  243. PCD
  244. ---
  245.  
  246. This is another script, but one designed to be used as a
  247. command. It's based on the AmigaDOS command "CD" which is
  248. used to change the current directory. If you use the command
  249. in the same was as CD, you won't notice any differrence for
  250. example:
  251.  
  252. (ma2.iff)
  253.  
  254.  
  255. However, when you enter PCD by itself, it returns to the
  256. last location you moved to, like this:
  257.  
  258. (ma3.iff)
  259.  
  260.  
  261.  
  262. DPAT & SPAT
  263. ------------
  264.  
  265.  
  266. These are two more scripts which can be treated like
  267. commands. They are used when you want to perform the same
  268. command on multiple files, and although there use is limited
  269. (not least because many commands already allow use on
  270. multiple files) they can occasionally be very useful.
  271.  
  272. SPAT is a "Single file PATtern" program. It allows you to
  273. include wildcards in commands. Wildcards are special symbols
  274. which can represent multiple files:
  275.  
  276.     #?             Means "all files"
  277.     #?.info     Means "all files ending in .info"
  278.     test.???    Means "all files starting in test. and
  279.                 ending with three letters, e.g. test.doc
  280.                 test.iff and test.bak"
  281.  
  282. Here's an example. Let's say you wanted to examine the
  283. version number of a library in the LIBS: drawer, you could
  284. do it like this:
  285.  
  286. (ma4.iff)
  287.  
  288. Now if you wanted to do it to all the file in the LIBS:
  289. drawer, you might try this. As you can see, it doesn't
  290. work.
  291.  
  292. (ma5.iff)
  293.  
  294. That's where SPAT comes in. Use it instead and you'll
  295. achieve the original aim.
  296.  
  297. (ma6.iff)
  298.  
  299.  
  300. DPAT works in a similar way except that it allows you to
  301. enter two filenames 
  302.  
  303.  
  304.  
  305. -- the end -- 
  306.